package com.qtu.product_service;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * SpringBoot使用两种技术和 ElasticSearch交互
 * 	1、Jest(默认不需要，如需要，可导对应Jar包)
 * 	2、SpringData ElasticSearch
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.qtu.product_service.feign")
@MapperScan("com.qtu.product_service.mapper")
public class ProductService8400Application {

	public static void main(String[] args) {
		/**
		 * Springboot整合Elasticsearch 在项目启动前设置一下的属性，防止报错
		 * 解决netty冲突后初始化client时还会抛出异常
		 * java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
		 */
		System.setProperty("es.set.netty.runtime.available.processors", "false");
		SpringApplication.run(ProductService8400Application.class, args);
	}

}
